Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when changing api in agent preview of endpoints summary #6802

Conversation

jbiset
Copy link
Member

@jbiset jbiset commented Jun 26, 2024

Description

This PR resolves the error when changing APIs in Agent preview of Endpoint Summary. To do this, the HOC withGuard is added to endpoint summary agent view. HOC withGuard is elevated from AgentWelcome, Inventory data, Stats, and Configuration to AgentView.
An EuiCallOut that is no longer necessary is also removed from main-agent, since it will not be rendered when there is no pinned agent. This also relocates the main-agent title so that it is rendered whenever there is an agent pinned.
Fixed setting breadcrumb when there is no agent information, so that it doesn't add an invalid bread.
Fixed agent selection button on the "No agent is selected" screen by modifying the pinAgent method.

Note

There is a previous closed PR 6800 since the branch was renamed.

Issues Resolved

Evidence

Syscollector

Evidence_Syscollector.webm

Stats

Evidence_Stats.webm

Configuration

Evidence_Configuration.webm

Test

  • Navigate to Endpoints Summary.
  • Select an agent.
  • Go to Syscollector (Inventory data) tab of the agent preview.
  • Change the API.
  • Check that the "No agent is selected" screen appears and that both the link to Endpoints Summary and the button to select an agent work.
  • Repeat the three last points with Stats and Configuration tabs.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@jbiset jbiset marked this pull request as ready for review June 26, 2024 13:47
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.96% ( 399 / 868 )
Branches 41.97% ( 157 / 374 )
Functions 44.01% ( 136 / 309 )
Lines 46.16% ( 397 / 860 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

@chantal-kelm chantal-kelm self-requested a review June 26, 2024 13:49
Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.2% ( 3993 / 32718 )
Branches 8.11% ( 1743 / 21483 )
Functions 11.7% ( 944 / 8066 )
Lines 12.39% ( 3890 / 31386 )

Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@JuanGarriuz
Copy link
Member

Test

  • Navigate to Endpoints Summary.
  • Select an agent.
  • Go to Syscollector (Inventory data) tab of the agent preview.
  • Change the API.
  • Check that the "No agent is selected" screen appears and that both the link to Endpoints Summary and the button to select an agent work.
  • Repeat the three last points with Stats and Configuration tabs.

Syscollector 🟢
image

Stats 🟢
image

Configuration 🟢

image

Copy link
Member

@chantal-kelm chantal-kelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evidence

Syscollector

Grabacion.de.pantalla.2024-06-26.a.la.s.11.20.51.a.m.mov

Stats

Grabacion.de.pantalla.2024-06-26.a.la.s.11.21.29.a.m.mov

Configuration

Grabacion.de.pantalla.2024-06-26.a.la.s.11.21.53.a.m.mov

@Desvelao Desvelao merged commit dc13c3c into 4.9.0 Jun 26, 2024
4 checks passed
@Desvelao Desvelao deleted the bug/6799-fix-error-when-changing-api-in-agent-preview-of-endpoints-summary branch June 26, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix error when changing API in Agent preview of Endpoints Summary
4 participants